home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_11_03 / 1103092a < prev    next >
Text File  |  1993-01-04  |  794b  |  30 lines

  1.      int SomeFunc(void)   
  2.           {
  3.           char    *buf1,  *buf2,  *buf3;       
  4.           int     ccode;          
  5.           if ((buf1 = malloc(1024)) == NULL)       
  6.                { 
  7.                ccode = -1;  
  8.                goto End1;       
  9.                }
  10.           if ((buf2 = malloc(1024)) == NULL)       
  11.                {
  12.                ccode = -1;  
  13.                goto End2;       
  14.                }
  15.           if ((buf3 = malloc(1024)) == NULL)       
  16.                {
  17.                ccode = -1;  
  18.                goto End3;
  19.                }
  20.           //    More code here      
  21. End3:       
  22.           free(buf3);      
  23. End2:       
  24.           free(buf2);      
  25. End1:       
  26.           free(buf1);          
  27.           return(ccode);   
  28.           }
  29.  
  30.